package com.jstyle.jclifexd.daoManager;

import com.jstyle.jclifexd.dao.EnableDataDao;
import com.jstyle.jclifexd.model.EnableData;
import com.jstyle.jclifexd.utils.DbManager;

import org.greenrobot.greendao.query.QueryBuilder;

/**
 * Created by Administrator on 2018/6/11.
 */

public class EnableDataDaoManager {
    
    public static void insertEnableData(EnableData enableData){
        DbManager.getInstance().getDaoSession().getEnableDataDao().insertOrReplace(enableData);
    }

    public static EnableData getEnableData(String key){
        QueryBuilder<EnableData> queryBuilder= DbManager.getInstance().getDaoSession().getEnableDataDao().queryBuilder();
        return   queryBuilder.where(EnableDataDao.Properties.Name.eq(key)).unique();
    }
}
